# -*- coding: utf-8 -*-
import os
import shutil
path =r"E:\矿产规划\收集资料\各矿山企业采矿证坐标\新增矿山".decode("utf-8")
all = os.listdir(path)
os.chdir(path)
for each in all:
    with open(each) as file:
        with open(each[:-4]+"chage.dat","w") as file41:
            lines = file.readlines()
            for eachline in lines:
                temp = ""

            # try:
                coord = eachline.split(",")
            # print(coord)
                temp = coord[3]
                coord[3] = coord[2]
                coord[2] = temp
                # coord[1] = each[:-4].encode("utf-8")
            # print(coord)
                file41.write(",".join(coord))
            # except:
            #     continue
                file41.flush()

